package com.net.marketing.service;

import java.io.Serializable;
import java.util.List;

import org.primefaces.model.DefaultTreeNode;
import org.primefaces.model.TreeNode;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.net.marketing.dao.MemberDetailsDao;
import com.net.marketing.domain.MemberDetails;

/**
 *@Author pao quilala
 *@Date   Aug 20, 2012
 **/
@Service("netMarketingService")
@Transactional
public class NetMarketingServiceImpl implements NetMarketingService,Serializable {

	private static final long serialVersionUID = -4531116353089256531L;
	private MemberDetailsDao memberDetailsDao;	
	
	/**
	 * @param memberDetailsDao the memberDetailsDao to set
	 */
	@Autowired
	public void setMemberDetailsDao(MemberDetailsDao memberDetailsDao) {
		this.memberDetailsDao = memberDetailsDao;
	}

	public void addMember(MemberDetails memberDetails) {
		// TODO Auto-generated method stub

	}

	public void deleteMember(long memberId) {
		this.memberDetailsDao.deleteMember(memberId);
	}

	public void updateMemberDetails(MemberDetails memberDetails) {
		// TODO Auto-generated method stub

	}

	public List<MemberDetails> listMemberDetails() {		
		return this.memberDetailsDao.getParent();
	}
	
	public TreeNode listMembersDetails(){
		TreeNode root = new DefaultTreeNode("root", null);
			
		return root;
	}

	public MemberDetails getMemberDetails(long memberId) {
		// TODO Auto-generated method stub
		return null;
	}

}
